Conversation
src/Http/Adapter/Swoole/Server.php
Outdated
| $this->server->set(\array_merge($settings, [ | ||
| 'enable_coroutine' => true | ||
| 'open_http2_protocol' => true, | ||
| // 'http_compression' => true, |
lohanidamodar
left a comment
There was a problem hiding this comment.
Looks good, left few comments
There was a problem hiding this comment.
may be we should remove this file
src/Http/Adapter/Swoole/Server.php
Outdated
| 'open_http2_protocol' => true, | ||
| // 'http_compression' => true, | ||
| // 'http_compression_level' => 6, | ||
|
|
||
| // Server | ||
| // 'log_level' => 2, | ||
| 'dispatch_mode' => 3, | ||
| 'worker_num' => $workerNumber, | ||
| 'reactor_num' => swoole_cpu_num() * 2, | ||
| 'task_worker_num' => $workerNumber, | ||
| 'open_cpu_affinity' => true, | ||
|
|
||
| // Coroutine | ||
| 'enable_coroutine' => true, | ||
| 'max_coroutine' => 300000, |
There was a problem hiding this comment.
don't we want to allow user to override these values?
| * | ||
| * @return array | ||
| */ | ||
| public static function getRoutes(): array |
There was a problem hiding this comment.
Why did we remove this?
src/Http/Http.php
Outdated
| unset(self::$resourcesCallbacks[$context]); | ||
| } | ||
| $this->server->onRequest(function ($request, $response) { | ||
| $context = clone $this->container; |
src/Http/Http.php
Outdated
| }, [], $context); | ||
| \call_user_func_array($error->getAction(), $this->getArguments($error, $context, [], $request->getParams())); | ||
| $dependency = new Dependency(); | ||
| $this->container->set( |
There was a problem hiding this comment.
shouldn't this error be set on context ?
There was a problem hiding this comment.
Not sure I follow, which error?
| * @param string $timezone | ||
| */ | ||
| public function __construct(Adapter $server, string $timezone) | ||
| public function __construct(Adapter $server, Container $container, string $timezone) |
There was a problem hiding this comment.
Why not make container optional and auto initialize if not provided?
| * | ||
| * @throws Exception | ||
| */ | ||
| public static function setResource(string $name, callable $callback, array $injections = [], string $context = 'utopia'): void |
There was a problem hiding this comment.
Why not also provide the setResource so that people can still set dependency using this method, but internally use the container to set these dependencies? I still like having this way to set resource here?
There was a problem hiding this comment.
You can now do getContainer->set();
Feat base servers
Feat: Rules for Multiple validator
# Conflicts: # composer.lock
No description provided.